<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>安装程序 -- GreenCMS</title>

    <include file="Public:head"/>

</head>
<body class="skin-blue">

<include file="Widget:header"/>

<div class="wrapper row-offcanvas row-offcanvas-left">


<!-- Left side column. contains the logo and sidebar -->
<aside class="left-side sidebar-offcanvas">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="__PUBLIC__/baracktocat.jpg" class="img-circle" alt="User Image"/>
            </div>
            <div class="pull-left info">

            </div>
        </div>
        <!-- search form -->
        <!--<form action="#" method="get" class="sidebar-form">-->
        <!--<div class="input-group">-->
        <!--<input type="text" name="q" class="form-control" placeholder="Search..."/>-->
        <!--<span class="input-group-btn">-->
        <!--<button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>-->
        <!--</span>-->
        <!--</div>-->
        <!--</form>-->
        <!-- /.search form -->
        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">


            <li class=""><a>使用协议书</a></li>
            <li class=""><a>环境测试</a></li>
            <li class="active"><a>网站设置</a></li>
            <li class=""><a>安装</a></li>
            <li class=""><a>安装完成</a></li>


        </ul>


    </section>
    <!-- /.sidebar -->
</aside>


<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
<!-- Content Header (Page header) -->


<!-- Main content -->
<section class="content">

<div class="row">
<div class="col-md-12">
<div class="box box-warning">
<div class="box-header">
    <h3 class="box-title">安装</h3>
</div>
<!-- /.box-header -->
<div class="box-body">


<div class="tabbable tabbable-custom tabbable-full-width">
    <div class="tab-content">
        <div class="tab-pane row-fluid active" id="tab_1_1">

            <form method="post" name="form1" action="{:U('Install/Index/Step4')}">
                <div class="span9">
                    <div class="portlet box light-grey">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-globe"></i>数据库设定
                            </div>
                        </div>
                        <div class="portlet-body">

                            <table class="table table-striped table-bordered table-hover">
                                <tbody id="server_info">
                                <tr>
                                    <td><strong>数据库主机：</strong></td>
                                    <td>
                                        <input type="text" id="dbhost" placeholder="" class="m-wrap medium"
                                               name="db_host" value="localhost">
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>数据库端口：</strong></td>
                                    <td>
                                        <input type="text" placeholder="" class="m-wrap medium"
                                               name="db_port" value="3306">
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>数据库用户：</strong></td>
                                    <td>
                                        <input type="text" id="dbuser" placeholder="" class="m-wrap medium"
                                               name="db_user" value="root">
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>数据库密码：</strong></td>
                                    <td>
                                        <input type="password" id="dbpwd" placeholder="" class="m-wrap medium"
                                               name="db_password" value="" onChange="TestDb();">

                                        <div style='float:right' id='dbpwdsta'></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>数据库名称：</strong></td>
                                    <td>
                                        <input type="text" id="dbname" placeholder="" class="m-wrap medium"
                                               name="db_name" value="green"
                                               onChange="HaveDB();">

                                        <div style='float:right' id='havedbsta'></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>数据表前缀：</strong></td>
                                    <td>
                                        <input type="text" id="dbprefix" placeholder="" class="m-wrap medium"
                                               name="db_prefix" value="green_">
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong>数据库编码：</strong></td>
                                    <td>
                                        <input type="radio" name="dblang" id="dblang_utf8" value="utf8"
                                               checked="checked"/>&nbsp;<label>UTF8</label>
                                    </td>
                                </tr>
                                </tbody>
                            </table>

                        </div>
                    </div>
                    <!--end span9-->
                </div>
                <!--end tab-pane-->
                <div class="tab-pane row-fluid active" id="tab_1_2">
                    <div class="span9">
                        <div class="portlet box light-grey">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="icon-globe"></i>管理员初始设置
                                </div>
                            </div>
                            <div class="portlet-body">
                                <table class="table table-striped table-bordered table-hover">
                                    <tbody id="system_env">
                                    <tr>
                                        <td><strong>用户名：</strong></td>
                                        <td>
                                            <input type="text" id="admin_user" placeholder=""
                                                   class="m-wrap medium"
                                                   name="admin_user" value="admin">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><strong>密　码：</strong></td>
                                        <td>
                                            <input type="password" id="admin_password" placeholder=""
                                                   class="m-wrap medium" name="admin_password" value="admin">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><strong>重复密码：</strong></td>
                                        <td>
                                            <input type="password" id="admin_password2" placeholder=""
                                                   class="m-wrap medium" name="admin_password2" value="admin">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><strong>管理员邮箱：</strong></td>
                                        <td>
                                            <input type="text" id="admin_email" placeholder=""
                                                   class="m-wrap medium"
                                                   name="admin_email" value="admin@njut.asia">
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <!--end span9-->
                    </div>
                    <!--end tab-pane-->
                    <div class="tab-pane row-fluid active" id="tab_1_3">
                        <div class="span9">
                            <div class="portlet box light-grey">
                                <div class="portlet-title">
                                    <div class="caption">
                                        <i class="icon-globe"></i>网站设置
                                    </div>
                                </div>
                                <div class="portlet-body">
                                    <table class="table table-striped table-bordered table-hover">
                                        <tbody id="dir_mod">
                                        <tr>
                                            <td><strong>网站名称：</strong></td>
                                            <td>
                                                <input type="text" id="cfg_title" placeholder=""
                                                       class="m-wrap medium" name="cfg_title"
                                                       value="GreenCMS 2014">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>站点根网址：</strong></td>
                                            <td>
                                                <input type="text" id="cfg_basehost" placeholder=""
                                                       class="m-wrap medium" name="cfg_basehost"
                                                       value="{$cfg_basehost}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>CMS安装目录：</strong></td>
                                            <td>
                                                <input type="text" id="cfg_cmspath" placeholder=""
                                                       class="m-wrap medium" name="cfg_cmspath"
                                                       value="{$cfg_cmspath}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>安装测试体验数据</strong></td>
                                            <td>
                                                <input name="demo" type="checkbox" id="installdemo"
                                                       value="1"
                                                       checked/>&nbsp;&nbsp;体验数据将含带GreenCMS大部分功能的应用操作示例
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <div class="form-actions row margin" >
                                        <div class="row margin">


                                            <button type="button" class="btn bg-red btn-back">
                                                <i class="m-icon-swapright m-icon-white"></i>
                                                后退
                                            </button>

                                            <button type="button" class="btn  bg-green btn-next" id='do_install'>
                                                <i class="m-icon-swapright m-icon-white"></i>开始安装
                                            </button>


                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--end span9-->
                        </div>
                        <!--end tab-pane-->
                    </div>
                </div>
                <!--END TABS-->

            </form>
        </div>
    </div>
</div>


</div>
</div>
</div>
</div>


</section>
<!-- /.content -->
</aside>
<!-- /.right-side -->
</div>
<!-- ./wrapper -->

<include file="Public:foot"/>


<script>
    jQuery(document).ready(function () {
        $('.btn-next').click(function () {
            DoInstall();
        });
        $('.btn-back').click(function () {
            window.location.href = '{:U("Install/Index/step2")}';
        });
    });
</script>

<script>

    function DoInstall() {
        //$o('postloader').style.display = 'block';
        document.form1.submit();
    }
</script>


</body>
</body>
</html>